/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SPasswordInfoConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.todo.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.UCN;
import com.thor.palmmall.rest.todo.ATask;
import com.thor.palmmall.spi.todo.STask;

/**
 * @author wolv
 *
 */
public class ATaskConverter implements Converter<STask, ATask> {

	public static ATaskConverter getInstance() {
		if (instance == null)
			instance = new ATaskConverter();
		return instance;
	}

	private static ATaskConverter instance;

	private ATaskConverter() {
	}

	@Override
	public ATask convert(STask source) {
		if (source == null)
			return null;

		ATask target = new ATask();
		target.setBillType(source.getBillType());
		target.setBillUuid(source.getBillUuid());
		target.setStore(UCN.newInstance(source.getStore()));
		target.setTime(source.getTime());
		target.setTitle(source.getTitle());
		target.setUuid(source.getUuid());

		return target;
	}

}
